/***************************************************************************
 *   Copyright (C) 2009 by Dead_Body                                       *
 *   jamesholodnak@gmail.com                                               *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef __rom_h__
#define __rom_h__

#include "defines.h"

typedef struct rom_s {
	char	filename[512];		//rom filename
	char	name[512];			//name of game (not in database? name == filename)
	u32	size,mask;			//rom size and mask
	u8		*data;				//rom data
	u32	bramsize,brammask;//battery ram size and mask
	u8		*bramdata;			//battery ram data
} rom_t;

u32 rom_createmask(u32 size);
rom_t *rom_load(const char *filename);
void rom_unload(rom_t *r);
u32 rom_crc32(rom_t *r);
int rom_checkdb(rom_t *ret,int whichdb);

#endif
